package top.csy8888.work2.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.csy8888.work2.dao.GoodsMapper;
import top.csy8888.work2.entity.Goods;
import top.csy8888.work2.service.GoodsService;

import java.util.List;

/**
 * @author CSY
 * @date 2025 - 09 - 17
 */
@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> listGoods(Integer pageNum, Integer pageSize) {
        return goodsMapper.listGoods(pageNum, pageSize);
    }

    @Override
    public Goods getGoodsById(Integer id) {
        return goodsMapper.getGoodsById(id);
    }

    @Override
    public boolean addGoods(Goods goods) {
        return goodsMapper.addGoods(goods);
    }

    @Override
    public boolean updateGoods(Goods goods) {
        return goodsMapper.updateGoods(goods);
    }

    @Override
    public boolean deleteGoods(Integer id) {
        return goodsMapper.deleteGoods(id);
    }


}
